package com.cyf.plc.data.remote

import com.cyf.plc.bean.*
import retrofit2.Response
import retrofit2.http.*

interface WeatherService {

    @GET("locations/v1/cities/ipaddress")
    suspend fun getKey(
        @Query("q") ip: String,
        @Query("apikey") apikey: String
    ): Response<WeatherKey>

    @GET("currentconditions/v1/{key}")
    suspend fun getWeather(
        @Path("key") key: String?,
        @Query("details") details: Boolean,
        @Query("apikey") apikey: String,
        @Query("languange") language: String
    ): Response<List<WeatherStatus>>

    @POST("remote-control/api/weather")
    suspend fun getWeather(
        @Body cityBean: CityBean?
    ): Response<WeatherResponse>

    @POST("api/floorList")
    suspend fun getFloorRoom(
        @Body deviceBean: DeviceBean
    ): Response<FloorRoomResponse>

    companion object {
        const val GET_WEATHER_URL = "http://api.accuweather.com/"
        const val API_KEY: String = "f6130725364d45b1a95875b6fa21f512"
//        const val GET_WEATHER_URL_OPEN_API = "https://wh.tgreen100.com/"

//        const val GET_WEATHER_URL_OPEN_API = "https://open.hopefun.cn/remote-control/"
//        https://www.bianzixiang.top/tcpnet/api/floorList
//        const val GET_WEATHER_URL_OPEN_API = "https://www.bianzixiang.top/tcpnet/"
        const val GET_WEATHER_URL_OPEN_API = "https://www.bianzixiang.top/tcp-net-v3/"
    }
}